home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / librw / RWGStack.z / RWGStack
Encoding:
Text File  |  1998-10-30  |  6.8 KB  |  199 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWGGGGSSSSttttaaaacccckkkk((((3333CCCC++++++++))))                                                  RRRRWWWWGGGGSSSSttttaaaacccckkkk((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWGStack(type) - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               #include <rw/gstack.h>
  13.  
  14.  
  15.  
  16.               declare(RWGStack,ttttyyyyppppeeee)
  17.           RWGStack(ttttyyyyppppeeee) a ;
  18.  
  19.  
  20.  
  21.  
  22. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  23.      Class RRRRWWWWGGGGSSSSttttaaaacccckkkk((((ttttyyyyppppeeee)))) represents a group of ordered elements, not
  24.      accessible by an external key.  A RRRRWWWWGGGGSSSSttttaaaacccckkkk((((ttttyyyyppppeeee)))) is a last in, first out
  25.      (LIFO) sequential list for which insertions and removals are made at the
  26.      beginning of the list.  Hence, the ordering is determined externally by
  27.      the ordering of the insertions.  Duplicates are allowed. This class is
  28.      implemented as a singly-linked list.  Objects of type RRRRWWWWGGGGSSSSttttaaaacccckkkk((((ttttyyyyppppeeee)))) are
  29.      declared with macros defined in the standard C++ header file <<<<ggggeeeennnneeeerrrriiiicccc....hhhh>>>>.
  30.      In order to find a particular item within the collection, a user-provided
  31.      global "tester" function is required to test for a "match," definable in
  32.      any consistent way.  This function should have prototype:
  33.  
  34.               RWBoolean yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrrFFFFuuuunnnnccccttttiiiioooonnnn(const ttttyyyyppppeeee* c, const void* d);
  35.  
  36.  
  37.  
  38.  
  39.  
  40.      The argument cccc is a candidate within the collection to be tested for a
  41.      match.  The argument dddd is for your convenience and will be passed to
  42.      yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrrFFFFuuuunnnnccccttttiiiioooonnnn(((()))).  The function should return TTTTRRRRUUUUEEEE if a "match" is
  43.      found between cccc and dddd.  In order to simplify the documentation below, an
  44.      imaginary typedef
  45.  
  46.               typedef RWBoolean (*yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr)(const ttttyyyyppppeeee*, const void*);
  47.  
  48.  
  49.  
  50.  
  51.  
  52.      has been used for this tester function.
  53.  
  54. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  55.      None
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWGGGGSSSSttttaaaacccckkkk((((3333CCCC++++++++))))                                                  RRRRWWWWGGGGSSSSttttaaaacccckkkk((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74. Public Constructors
  75.               RRRRWWWWGGGGSSSSttttaaaacccckkkk((((ttttyyyyppppeeee))))();
  76.  
  77.  
  78.      Constructs an empty stack.
  79.  
  80.               RRRRWWWWGGGGSSSSttttaaaacccckkkk((((ttttyyyyppppeeee))))(ttttyyyyppppeeee* a);
  81.  
  82.  
  83.      Constructs a stack with one entry aaaa.
  84.  
  85.               RRRRWWWWGGGGSSSSttttaaaacccckkkk((((ttttyyyyppppeeee))))(const RWGStack(ttttyyyyppppeeee)& a);
  86.  
  87.  
  88.      Copy constructor.  A shallow copy of aaaa is made.
  89.  
  90. AAAAssssssssiiiiggggnnnnmmmmeeeennnntttt OOOOppppeeeerrrraaaattttoooorrrr
  91.               void
  92.           ooooppppeeeerrrraaaattttoooorrrr====(const RWGStack(ttttyyyyppppeeee)& a);
  93.  
  94.  
  95.      Assignment operator.  A shallow copy of aaaa is made.
  96.  
  97. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  98.               void
  99.           cccclllleeeeaaaarrrr();
  100.  
  101.  
  102.      Removes all items from the stack.
  103.  
  104.               RWBoolean
  105.           ccccoooonnnnttttaaaaiiiinnnnssss(yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr tttt, const void* d) const;
  106.  
  107.  
  108.      Returns TTTTRRRRUUUUEEEE if the stack contains an item for which the user-defined
  109.      function pointed to by tttt finds a match with dddd.
  110.  
  111.               RWBoolean
  112.           ccccoooonnnnttttaaaaiiiinnnnssssRRRReeeeffffeeeerrrreeeennnncccceeee(const ttttyyyyppppeeee* e) const;
  113.  
  114.  
  115.      Returns TTTTRRRRUUUUEEEE if the stack contains an item with the address eeee....
  116.  
  117.               size_t
  118.           eeeennnnttttrrrriiiieeeessss() const;
  119.  
  120.  
  121.      Returns the number of items in the stack.
  122.  
  123.               RWBoolean
  124.           iiiissssEEEEmmmmppppttttyyyy() const;
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRWWWWGGGGSSSSttttaaaacccckkkk((((3333CCCC++++++++))))                                                  RRRRWWWWGGGGSSSSttttaaaacccckkkk((((3333CCCC++++++++))))
  137.  
  138.  
  139.  
  140.      Returns TTTTRRRRUUUUEEEE if the stack is empty, otherwise FFFFAAAALLLLSSSSEEEE.
  141.  
  142.               size_t
  143.           ooooccccccccuuuurrrrrrrreeeennnncccceeeessssOOOOffff(yyyyoooouuuurrrrTTTTeeeesssstttteeeerrrr t, const void* d) const;
  144.  
  145.  
  146.      Returns the number of items in the stack for which the user-provided
  147.      function pointed to by tttt finds a match with dddd.
  148.  
  149.               size_t
  150.           ooooccccccccuuuurrrrrrrreeeennnncccceeeessssOOOOffffRRRReeeeffffeeeerrrreeeennnncccceeee(const ttttyyyyppppeeee* e) const;
  151.  
  152.  
  153.      Returns the number of items in the stack with the address eeee....
  154.  
  155.               ttttyyyyppppeeee*
  156.           ppppoooopppp();
  157.  
  158.  
  159.      Removes and returns the item at the top of the stack, or returns nnnniiiillll if
  160.      the stack is empty.
  161.  
  162.               void
  163.           ppppuuuusssshhhh(ttttyyyyppppeeee* a);
  164.  
  165.  
  166.      Adds an item to the top of the stack.
  167.  
  168.               ttttyyyyppppeeee*
  169.           ttttoooopppp() const;
  170.  
  171.  
  172.      Returns the item at the top of the stack or nnnniiiillll if the stack is empty.
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.